﻿<!DOCTYPE html>
<html lang="en">
<!--[if lte IE 9]>
<script>window.location.href='http://support.dmeng.net/upgrade-your-browser.html?referrer='+encodeURIComponent(window.location.href);</script>
<![endif]-->
<head>
    <meta charset="UTF-8">
    <title>登录/注册</title>
    <link rel="stylesheet" href="__CSS__/supplies/bootstrap.min.css">
    <link rel="stylesheet" href="__CSS__/supplies/common.css">
    <link rel="stylesheet" href="__CSS__/supplies/login.css">
    <link rel="stylesheet" href="__CSS__/supplies/register.css">
    <style>
        html,body{
            font-family: '微软雅黑';
        }
        html,body{overflow: hidden}
        .select_a{
            text-decoration: none;
            padding-top:4px;
            display: block;
            width: 300px;
            height: 44px;
            text-align: center;
            color: white;
            line-height: 18px;
            out-line: none;
        }

        .select_a:hover{
            text-decoration: none;
            color: white;
            background-color: #BDBDBD;
        }
        .select_a:visited{
            text-decoration: none;
            color: white;
        }
        .select_a:active{
            text-decoration: none;
            color: white;
        }
        a:focus{
            text-decoration: none;
            color:#fff;
        }
        .placeholder{
            width: 300px;
            height: 44px;
            padding:4px 10px;
            /*border: 1px solid #DEDEDE;*/
        }
        .commint_btnt {
            width: 300px;
            margin: 0 auto;
            margin-top: 30px;
        }
        .form_contentt {
            width: 100%;
        }
        .reg_contenth{
            width: 432px;
            height: 620px;
            border: 1px solid #FEF8EF;
            background-color: #FFFCF9;
            margin: auto;
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            -webkit-box-shadow: 0px 0px 40px rgba(243,188,145,0.2);
            box-shadow: 0px 0px 40px rgba(243,188,145,0.2);
        }
        .form_contenth{
            width: 100%;
            height: 370px;
        }
        #register,#smsLogin,#resetPassword,#authenticationInfo{display: none}
        .get_code:hover{
            background-color: #fff;
        }

        input{
            background-color: #FFFCF9;
            border: 1px solid #dedede;
        }

        .btn_save {
            width: 120px;
            height: 32px;
            text-align: center;
            margin-top: 20px;
            line-height: 30px;
            cursor: pointer;

        }

        .btn_cancel {
            width: 120px;
            height: 32px;
            line-height: 30px;
            text-align: center;
            background-color: white;
            border: 1px solid #DEDEDE;
            margin-top: 20px;
            color: #666666;
            margin-right: 20px;
            cursor: pointer;
        }
        .reg_form_box{
            width: 100%;
            padding: 0 69px;
        }
        .form_box{
            width: 100%;
            padding: 0 65px;
        }
        .input_cont_box{
            border:1px solid #DEDEDE;
            padding: 4px 10px
        }
        .input_code_box{
            float: left;
            width: 140px;
            margin-right: 8px;
            border:1px solid #DEDEDE;
            padding: 4px 10px
        }
        input:-webkit-autofill {
            -webkit-box-shadow: 0 0 0 1000px #FFFCF9 inset;
        }
        .my_margin_bottom{
            margin-bottom: 22px;
        }
        .my_margin_top{
            margin-top: 22px;
        }
        .input_title .input_title_zh{
            font-size: 14px;
            color: #DEDEDE;
            line-height: 18px;
        }
        .input_title .input_title_en{
            font-size: 14px;
            color: #DEDEDE;
            line-height: 18px;
        }
        .input_code{
            display: none;
            width: 100%;
            height: 34px;
            border: none;
            line-height: 34px;
        }
        .input_sty{
            display: none;
            width: 100%;
            border: none;
            height: 36px;
            line-height: 34px;
        }
        .input_sty:focus,.input_code:focus{
            outline: none;
        }
        .get_code_btn{
            box-sizing: border-box;
            padding: 5px;
            width: 150px;
            height: 46px;
            overflow: hidden;
            border: 1px solid #FF6A0E;
            cursor: pointer;
            background-color: #FFF;
            outline: none;
        }
        .get_code_btn .my_title_zh{
            font-size: 14px;
            color: #FF6A0E;
            text-align: center;
            line-height: 16px;
        }
        .get_code_btn .my_title_en{
            font-size: 12px!important;
            color: #FF6A0E;
            text-align: center;
        }
        .forget_password_box{
            width: 100%;
            overflow: hidden;
        }
        .forget_password_title{
            float: right;
            padding: 10px 0;
            font-size: 12px;
            overflow: hidden;
        }
        .forget_password_title a{
            color: #666;
            cursor: pointer;
        }
        .select_a{
            cursor: pointer;
        }
    </style>
</head>
<body>
<div class="reg_container"  style="z-index: -9999">
    <canvas id='circle1' style="position:absolute;z-index:0;"></canvas>

    <canvas id='circle2' style="position:absolute;z-index:0;"></canvas>

    <canvas id='circle3' style="position:absolute;z-index:2222;"></canvas>

    <canvas id='circle4' style="position:absolute;z-index:4444;"></canvas>

    <canvas id='circle5' style="position:absolute;z-index:9999;"></canvas>

    <canvas id='cloud1' style="position:absolute;z-index:0;"></canvas>
    <canvas id='cloud2' style="position:absolute;z-index:0;"></canvas>
</div>
<div class="reg_content form-inline" style="z-index: 9999">

    <div class="reg_left_from form-group" id="passwordlogin">
        <div class="form_title" style="font-size: 24px;line-height: 24px;color: #FF690D;">
            登录</br><span class="font_size_16">login</span>
        </div>
        <div class="form_content">
            <div class="form_box">
                <div class="input_cont_box my_margin_bottom">
                    <input type="text" id="phone" class="input_sty tel" onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">手机号</div>
                        <div class="input_title_en">mobile number</div>
                    </div>
                </div>
                <div class="input_cont_box">
                    <input type="password" id="password" class="input_sty pwd"  onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">密码</div>
                        <div class="input_title_en">password</div>
                    </div>
                </div>
                <div class="forget_password_box">
                    <div class="forget_password_title">
                        <a onclick="herf('resetPassword')">忘记密码？forgotten password?</a>
                    </div>
                </div>
            </div>
            <div class="commint_btn" id="pwdLogin" style="margin-top: 25px;">
                <a class="select_a btn_color_right font_size_14" style="cursor:pointer;">登录</br>login</a>
            </div>
            <div class="login_remark" style="font-size: 12px;overflow: hidden">
                <div style="float: left;cursor: pointer" onclick="herf('smsLogin')">短信登录<p style="font-size:12px;color:#666">login with sms message</p></div>
                <div style="float: right;cursor: pointer;text-align: right;" onclick="herf('register')">注册<p style="font-size:12px;color:#666">register</p></div>
            </div>
        </div>
    </div>
    <div class="reg_container" id="smsLogin">
        <div class="reg_content form-inline">
            <div class="reg_left_from form-group">
                <div class="form_title" style="font-size: 24px;line-height: 24px;color: #FF690D;">
                    登录</br><span class="font_size_16">login</span>
                </div>
                <div class="form_content" style="height: 130px;">
                    <div class="form_box">
                        <div class="input_cont_box my_margin_bottom">
                            <input type="text" id="codeTel" class="input_sty tel" onblur="showInput(this)">
                            <div class="input_title" onclick="hiddenDiv(this)">
                                <div class="input_title_zh">手机号</div>
                                <div class="input_title_en">mobile number</div>
                            </div>
                        </div>
                        <div class="input_code_box my_margin_bottom">
                            <input type="text" id="code" class="input_code" onblur="showInput(this)">
                            <div class="input_title" onclick="hiddenDiv(this)">
                                <div class="input_title_zh">验证码</div>
                                <div class="input_title_en">notification code</div>
                            </div>
                        </div>
                        <button class="get_code_btn" id="getCode">
                            <div class="my_title_zh">获取验证码</div>
                            <div class="my_title_en">obtain verification code</div>
                        </button>
                    </div>
                </div>
                <div class="commint_btn">
                    <a class="select_a font_size_14 btn_color_right " id="codeLogin">登录</br><span class="font_size_11">Login</span></a>
                </div>
                <div class="login_remark" style="font-size: 12px;overflow: hidden">
                    <div style="float: left;cursor: pointer" onclick="herf('passwordlogin')">密码登录<p style="font-size:12px;color:#666">password login</p></div>
                    <div style="float: right;cursor: pointer;text-align: right;" onclick="herf('register')">注册<p style="font-size:12px;color:#666">register</p></div>
                </div>
            </div>
        </div>
    </div>
    <div class="reg_left_from form-group" id="resetPassword">
        <div class="form_title" style="font-size: 24px;line-height: 24px;color: #FF690D;">
            找回密码</br><span class="font_size_16">retrieve password</span>
        </div>
        <div class="form_contentt">
            <div class="form_box">
                <div class="input_cont_box my_margin_bottom my_margin_top">
                    <input type="text" id="resetTel" class="input_sty tel" onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">手机号</div>
                        <div class="input_title_en">mobile number</div>
                    </div>
                </div>
               <div style="display: flex;justify-content: flex-start;flex-flow: row nowrap">
                   <div class="input_code_box my_margin_bottom">
                       <input type="text" id="resetCode" class="input_code" onblur="showInput(this)">
                       <div class="input_title" onclick="hiddenDiv(this)">
                           <div class="input_title_zh">验证码</div>
                           <div class="input_title_en">notification code</div>
                       </div>
                   </div>
                   <button class="get_code_btn my_margin_bottom" id="resetGetCode">
                       <div class="my_title_zh">获取验证码</div>
                       <div class="my_title_en">obtain verification code</div>
                   </button>
               </div>
                <div class="input_cont_box">
                    <input type="password" id="resetNewPassword" class="input_sty password" onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">新密码</div>
                        <div class="input_title_en">new password</div>
                    </div>
                </div>
            </div>
        </div>
        <div class="commint_btnt" style="margin-top: 40px;">
            <a class="select_a btn_color_right font_size_14" id="resetSubmit" style="cursor:pointer;line-height: 13px;padding-top: 8px;">重置密码</br><span class="font_size_11">rest password</span></a>
            <!--<button>重置密码</br>rest password</button>-->
        </div>
    </div>
</div>
<div class="reg_contentd form-inline" id="register" style="z-index: 9999">

    <div class="reg_left_fromd form-group">
        <div class="form_titled" style="font-size: 24px;line-height: 24px;color: #FF690D;">
            注册</br><span class="font_size_16">register</span>
        </div>
        <div class="form_contentd">
            <div class="reg_form_box">
                <div class="input_cont_box my_margin_bottom">
                    <input type="text" id="registerTel" class="input_sty tel" onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">手机号</div>
                        <div class="input_title_en">mobile number</div>
                    </div>
                </div>
                <div class="input_code_box my_margin_bottom">
                    <input type="text" id="registerCode" class="input_code" onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">验证码</div>
                        <div class="input_title_en">notification code</div>
                    </div>
                </div>
                <button class="get_code_btn my_margin_bottom" id="registerGetCode">
                    <div class="my_title_zh">获取验证码</div>
                    <div class="my_title_en">obtain verification code</div>
                </button>
                <div class="input_cont_box">
                    <input type="password" id="registerPwd" class="input_sty password" onblur="showInput(this)">
                    <div class="input_title" onclick="hiddenDiv(this)">
                        <div class="input_title_zh">密码</div>
                        <div class="input_title_en">password</div>
                    </div>
                </div>
            </div>
            <div class="agreement form-inline input_div" id="registerIs" read="" style="font-size: 12px;">
                <div  id="checked"></div>
                <img src="/image/supplies/icon/checked.png" alt=""  id="check" >

                <div class="agreement_remark form-group">阅读并接受<a class="b" data-toggle="modal" data-target="#userAgreement" id="getAgreement">《用户协议》</a></br>
                    <span style="color: #666;">please read and accept <a class="b" data-toggle="modal" data-target="#userAgreement">user agreement</a></span></div>
            </div>
        </div>
        <div class="commint_btnd" style="margin-top: 40px">
            <div class="select_ad btn_color_right font_size_14" id="registerSubmit" style="cursor:pointer;width: 100%" >注册</br><span class="font_size_11">register</span></div>
        </div>
        <div class="login_remarkd" style="font-size: 12px;">
            <div style="cursor: pointer;" onclick="herf('passwordlogin')">已有账号 ,<span style="color: #FF690D">去登录</span></br><span style="color: #666;">already has an account, please login</span></div>
        </div>
    </div>
    <div class="fg form-group"></div>
    <div class="reg_register_remark form-group">
        <div class="app_code">
            <!-- <img src="/image/supplies/mine/code.png" >-->
            <div class="code_img">
                <img id="codeImage" src="">
                <div class="code_title">android</div>
            </div>
            <div class="code_img">
                <img id="iosCodeImage" src="">
                <div class="code_title">ios</div>
            </div>
        </div>
        <div class="remark">
            <div class="font_size_14">
                下载手机客户端</br><span class="font_size_11" style="color: #666;">download the mobile client</span>
            </div>
            <div class="font_size_14">随时随地管理你的店铺</br><span class="font_size_11" style="color: #666;">buy products anytime, anywhere</span></div>

        </div>
    </div>
    <!-- 用户协议 -->
    <div class="modal fade font_size_14" id="userAgreement" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2"
         aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content" style="border-radius: 0">
                <div class="modal-body">
                    <div id="userAgreementData">sss</div>
                </div>
                <div class="modal-footer">
                    <button  class="btn_cancel" data-dismiss="modal" >取消(cancel)</button>
                    <button  class="btn_save btn-2" id="agreeIs" data-dismiss="modal" style="border: 0">接受(accept)</button>

                </div>

            </div>
        </div>
    </div>
</div>

</body>
<script rel="script" src="/js/jquery-3.2.1.min.js"></script>
<script rel="script" src="/js/supplies/jquery.min.js"></script>
<script rel="script" src="/js/supplies/bootstrap.min.js"></script>
<script rel="script" src="/js/supplies/validator/validator.js"></script>
<script rel="script" src="/js/layer.js"></script>
<script rel="script" src="/js/supplies/common.js"></script>
<script rel="script" src="/js/supplies/common_input.js"></script>
<script>

    $(function(){
        isShowInputTips();
        getCodeImage()
    })





    /**
     * @description : 验证码登录 一分钟倒计时
     * @params:
     * @author : peng huaneng
     * @date : 2018/3/6 10:48
     */
    var smsLoginCountFlag = true;
    var smsLoginCount = 59;
    function smsLoginCountDown(domId)
    {
        if(59 == smsLoginCount ){
            $(domId).removeClass("getCode") ;
            $(domId).addClass("retCode") ;
            smsLoginCountFlag = false ;
        }
        if(smsLoginCount>0){
            var html = "<div> <span style='float: right;margin-right: 10px'>重新发送 <br>Resend</span> " +
                " <span style='float: right;margin-top: 10px;margin-right: 10px'>" + smsLoginCount + "S</span> </div>" ;
            $(domId).html( html) ;
            smsLoginCount -- ;
            setTimeout(function () {
                smsLoginCountDown(domId) ;
            },1000) ;
        }else {
            $(domId).removeClass("retCode") ;
            $(domId).addClass("getCode") ;
            $(domId).html( "重新发送 <br>Resend") ;
            smsLoginCount = 59;
            smsLoginCountFlag = true;
        }
    }
    /**
     * @description : 重置密码 一分钟倒计时
     * @params:
     * @author : peng huaneng
     * @date : 2018/3/6 10:48
     */
    var resPswdCountFlag = true;
    var resPswdCount = 59;
    function resPswdCountDown(domId)
    {
        if(59 == resPswdCount ){
            $(domId).removeClass("getCode") ;
            $(domId).addClass("retCode") ;
            resPswdCountFlag = false ;
        }
        if(resPswdCount>0){
            var html = "<div> <span style='float: right;margin-right: 10px'>重新发送 <br>Resend</span> " +
                " <span style='float: right;margin-top: 10px;margin-right: 10px'>" + resPswdCount + "S</span> </div>" ;
            $(domId).html( html) ;
            resPswdCount -- ;
            setTimeout(function () {
                resPswdCountDown(domId) ;
            },1000) ;
        }else {
            $(domId).removeClass("retCode") ;
            $(domId).addClass("getCode") ;
            $(domId).html( "重新发送 <br>Resend") ;
            resPswdCount = 59;
            resPswdCountFlag = true;
        }
    }

    /**
     * @description : 注册 一分钟倒计时
     * @params:
     * @author : peng huaneng
     * @date : 2018/3/6 10:48
     */
    var registerCountFlag = true;
    var registerCount = 59;
    function registerCountDown(domId)
    {
        if(59 == registerCount ){
            $(domId).removeClass("getCode") ;
            $(domId).addClass("retCode") ;
            registerCountFlag = false ;
        }
        if(registerCount>0){

            var html = "<div > <span style='float: right;margin-right: 10px'>重新发送 <br>Resend</span> " +
                " <span style='float: right;margin-top: 10px;margin-right: 10px'>" + registerCount + "S</span> </div>" ;
            $(domId).html( html) ;
            registerCount -- ;
            setTimeout(function () {
                registerCountDown(domId) ;
            },1000) ;
        }else {
            $(domId).removeClass("retCode") ;
            $(domId).addClass("getCode") ;
            $(domId).html( "重新发送 <br>Resend") ;
            registerCount = 59;
            registerCountFlag = true;
        }
    }


    //验证码登录
    $('#getCode').click(function(){ //获取验证码
        var phone = $('#codeTel').val();
        if (phone){
            if (!checkTel(phone)) return false;
        }
        if (checkValue($("#codeTel"),"phone")) {
            $tel = phone ;
            $.ajax({
                type: "post",
                url: "__APP__/apishop/index/getMsgCode",
                cache: false,
                data: {tel: $tel, tag: 'codeLogin'},
                dataType: "json",
                success: function (data) {
                    //console.log(data);
                    if(200 == data.status){
                        if (smsLoginCountFlag) {
                            smsLoginCountDown("#getCode");
                        }
                    }else{
                        layer.msg(data.msg,{
                            skin:'winning-class',//自定义样式winning-class
                            time:3000
                        }) ;
                    }

                }
            });


        }else{
            $('#codeTel').focus();
        }
    })

    //找回密码
    $('#resetGetCode').click(function(){ //获取验证码
        var phone = $('#resetTel').val();
        if (phone){
            if (!checkTel(phone)) return false;
        }
        if (checkValue($("#resetTel"),"phone")) {
            $tel = phone ;
            if (resPswdCountFlag) {

                $.ajax({
                    type: "post",
                    url: "__APP__/apishop/index/getMsgCode",
                    cache: false,
                    data: {tel: $tel, tag: 'resetPassword'},
                    dataType: "json",
                    success: function (data) {
                        if(200==data.status){
                            resPswdCountDown("#resetGetCode");
                        }else{
                            layer.msg(data.msg,{
                                skin:'winning-class',//自定义样式winning-class
                                time:3000
                            })
                        }
                    }
                });
            }
        }else {
            $('#resetTel').focus();
        }

    })

    //商户注册
    $('#registerGetCode').click(function(){
        var phone = $('#registerTel').val();
        if (phone){
            if (!checkTel(phone)) return false;
        }
        if (checkValue($("#registerTel"),"phone")) {
            $tel = phone;

            $tel = $('#registerTel').val();
            $.ajax({
                type: "post",
                url: "__APP__/apishop/index/getMsgCode",
                cache: false,
                data: {tel: $tel, tag: 'register'},
                dataType: "json",
                success: function (data) {

                    if (200 == data.status) {
                        if (registerCountFlag) {
                            registerCountDown("#registerGetCode")

                        }
                    }
                    else {
                        layer.msg(data.msg,{
                            skin:'winning-class',//自定义样式winning-class
                            time:3000
                        })
                    }
                }
            });


        }else {
            $('#registerTel').focus();
        }
    })
    //注册获取用户协议
    $('#getAgreement').click(function(){ //获取验证码
        $.ajax({
            type: "post",
            url: "__APP__/apishop/apishop/getAgreementData",
            cache: false,
            data: '',
            dataType: "json",
            success: function (data) {
                $('#userAgreementData').html(data['data'].content);
            }
        });
    })
    //获取商户二维码
    function getCodeImage(){ //获取验证码
        $.ajax({
            type: "post",
            url: "__APP__/apishop/apishop/getCodeImage",
            cache: false,
            data: '',
            dataType: "json",
            success: function (data) {
                $url = oss_url + data['data'].value;
                var ios_image = oss_url + data['data'].ios_image;
                $('#codeImage').attr('src',$url);
                $('#iosCodeImage').attr('src',ios_image);
            }
        });
    }
    $('#agreeIs').click(function(){
        $("#check").show();
        $("#checked").hide();

        $("#checked").parent().attr('read',1);
    })
    $('#registerSubmit').click(function(){
        if (checkValue($("#registerTel"),"phone") &&
            checkValue($("#registerPwd"),"password")&&
            checkValue($("#registerCode"),"number")
        ) {
            $tel =  $('#registerTel').val();
            $password =  $('#registerPwd').val();
            $code =  $('#registerCode').val();
            $is =  $('#registerIs').attr('read');
            if('' == $tel){
                layer.msg('请输入手机号</br>Please enter the phone number',{
                    skin:'winning-class',//自定义样式winning-class
                    time:3000
                });
            }else if('' == $code){
                layer.msg('请输入验证码</br>Please enter the verification code',{
                    skin:'winning-class',//自定义样式winning-class
                    time:3000
                });
            }else if('' == $password){
                layer.msg('请输入密码</br>Please enter the password',{
                    skin:'winning-class',//自定义样式winning-class
                    time:3000
                });
            }else if(5>=$password.length || 17<=$password.length){
                layer.msg('请输入6-16位密码</br>Please enter 6-16 bit passwords',{
                    skin:'winning-class',//自定义样式winning-class
                    time:3000
                });
            }else if('1'!==$is){
                layer.msg('你还没有同意用户协议</br>You haven\'t agreed to the user agreement',{
                    skin:'winning-class',//自定义样式winning-class
                    time:3000
                });
            }else{
                $.ajax({
                    type: "get",
                    url: "__APP__/apishop/apishop/register",
                    cache: false,
                    data: {tel: $tel, pwd: $password, code: $code, is: $is},
                    dataType: "json",
                    success: function (data) {
                        if (200 == data['status']) {
                            location.href = "__APP__/supplies/index/authenticationInfo";
                        }else{
                            layer.msg(data.msg,{
                                skin:'winning-class',//自定义样式winning-class
                                time:3000
                            }) ;
                        }
                    }
                });
            }
        }
    }) ;

    $('#codeLogin').click(function(){

        if (checkValue($("#codeTel"),"phone") && checkValue($("#code"),"number")) {
            $tel =  $('#codeTel').val();
            $code =  $('#code').val();
            $.ajax({
                type: "post",
                url: "__APP__/apishop/apishop/codeLogin",
                cache: false,
                data: {tel: $tel,code: $code,type: 'WEB'},
                dataType: "json",
                success: function (data) {
                    if (200 == data['status']) {
                        localStorage.setItem("suppliesId",data.info.id);
                        localStorage.setItem("web_token",data.info.web_token);
                        localStorage.setItem("faultMsg",data.info.message);
                        location.href = "__APP__/supplies/index/index";
                    }else{
                        layer.msg(data.msg,{
                            skin:'winning-class',//自定义样式winning-class
                            time:3000
                        })
                    }
                }
            });
        }
    });

    $('#resetSubmit').click(function(){

        if (checkValue($("#resetTel"),"phone") && checkValue($("#resetCode"),"number")
        && checkValue($("#resetNewPassword"),"password") ) {
            $tel =  $('#resetTel').val();
            $password =  $('#resetNewPassword').val();
            $code =  $('#resetCode').val();
        }else {
            return ;
        }

        $.ajax({
            type: "post",
            url: "__APP__/apishop/apishop/findPassword",
            cache: false,
            data: {tel: $tel, pwd: $password, code: $code},
            dataType: "json",
            success: function (data) {
                // console.log(data);
                if (200 == data['status']) {
                    location.href = "__APP__/supplies/index/login";
                }else{
                    layer.msg(data.msg,{
                        skin:'winning-class',//自定义样式winning-class
                        time:3000
                    })
                }
            }
        });


    }) ;



    //账号密码登录
    $('#pwdLogin').click(function(){

            if (checkValue($("#phone"),"phone")) {
            $tel =  $('#phone').val();
            $password =  $('#password').val();
            $.ajax({
                type: "post",
                url: "__APP__/apishop/apishop/login",
                cache: false,
                data: {tel: $tel, pwd: $password,type: 'WEB'},
                dataType: "json",
                success: function (data) {
                    if (200 == data['status']) {
                        localStorage.setItem("suppliesId",data.info.id);
                        localStorage.setItem("web_token",data.info.web_token);
                        localStorage.setItem("faultMsg",data.info.message);
                        location.href = "__APP__/supplies/index/index";
                    }else{
                        layer.msg("账号密码不匹配！<br>Account password mismatch ",{
                            skin:'winning-class',//自定义样式winning-class
                            time:3000
                        });
                    }
                }
            });
        }
    } )


    function herf(link){
        if(link=='passwordlogin'){
            $("#passwordlogin").show();
            $("#register").hide();
            $("#smsLogin").hide();
            $("#resetPassword").hide();
            $("#authenticationInfo").hide();
        }
        if(link=='register'){
            $("#register").show();
            $("#passwordlogin").hide();
            $("#smsLogin").hide();
            $("#resetPassword").hide();
            $("#authenticationInfo").hide();
        }
        if(link=='smsLogin'){
            $("#smsLogin").show();
            $("#passwordlogin").hide();
            $("#register").hide();
            $("#resetPassword").hide();
            $("#authenticationInfo").hide();
        }
        if(link=='resetPassword'){
            $("#resetPassword").show();
            $("#smsLogin").hide();
            $("#passwordlogin").hide();
            $("#register").hide();
            $("#authenticationInfo").hide();
        }
        if(link=='authenticationInfo'){
            $("#authenticationInfo").show();
            $("#resetPassword").hide();
            $("#smsLogin").hide();
            $("#passwordlogin").hide();
            $("#register").hide();
        }

    }
    $('#check').click(function(){
        $("#check").hide();
        $("#checked").show();
        $(this).parent().attr('read',0);
    })
    $('#checked').click(function(){
        $("#check").show();
        $("#checked").hide();
        $(this).parent().attr('read',1);
    })



    var circle1 = document.getElementById("circle1");
    var circle2 = document.getElementById("circle2");
    var circle3 = document.getElementById("circle3");
    var circle4 = document.getElementById("circle4");
    var circle5 = document.getElementById("circle5");

    var cloud1 = document.getElementById("cloud1");
    var cloud2 = document.getElementById("cloud2");

    circle1.width = circle2.width = circle3.width = circle4.width = circle5.width = cloud1.width = cloud2.width = document.body.clientWidth;
    circle1.height = circle2.height = circle3.height = circle4.height = circle5.height =  cloud1.height = cloud2.height= document.body.clientHeight;

    var width=document.body.clientWidth-30;
    var widthleft=document.body.clientWidth/12;
    var widthright=document.body.clientWidth/1.2;
    var height_top=document.body.clientHeight/8;
    drawcircle("circle1", widthleft, height_top, 50,'#FFE7D8','#FFDFCC');

    drawcircle("circle2", widthright, 250, 35,'#FFE7D8','#FFDFCC');

    drawcircleo("circle3", width, 20, 120,'#FEE0CE','#FEFEFE');

    drawcirclet("circle4", width, 20, 75,'#FEE0CE','#FEFEFE');

    drawcirclef("circle5", width, 20, 40,'#FEE0CE','#FEFEFE');

    // drawcircle("circle3", 1300, 300, 35,'#FEFEFE','#FF690D');

    //绘制右上角
    function drawcircle(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 50);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    //绘制圆
    function drawcircle(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 50);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }

    //绘制右上角顶部大圆
    function drawcircleo(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 100);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    //绘制顶部大圆
    function drawcircleo(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 100);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    //绘制右上角顶部中圆
    function drawcirclet(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 80);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    //绘制顶部中圆
    function drawcirclet(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 80);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    //绘制右上角顶部小圆
    function drawcirclef(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 50);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    //绘制顶部小圆
    function drawcirclef(canvasName, cx, cy, cw, fircolor , seccolor) {
        var draw = document.getElementById(canvasName);
        if (draw.getContext) {
            var context = draw.getContext('2d');
            //开始路径
            context.beginPath();
            //绘制外圆
            context.arc(cx, cy, cw, 0, 360, false);
            var gradient = context.createRadialGradient(cx, cy, 30, cx, cy, 50);
            gradient.addColorStop(0, fircolor);//    //0表示开始
            gradient.addColorStop(1, seccolor);    //1表示结束
            //使用定义好的渐变属性
            context.fillStyle = gradient;    //填充的时候放入渐变
            context.fill();//画实心圆
        }
    }
    var canvas = document.getElementById("cloud1");
    var ctx = canvas.getContext("2d");
    var width_yuntop=document.body.clientWidth/2-100;
    var height_yuntop=document.body.clientHeight/7;
    drawCloud(ctx, width_yuntop, height_yuntop, 100);

    var cloud2 = document.getElementById("cloud2");
    var ctx2 = cloud2.getContext("2d");
    var width_yun2left=document.body.clientWidth/4-100;
    var height_yun2left=document.body.clientHeight/2;
    drawCloud(ctx2, width_yun2left, height_yun2left, 130);

    /*渲染单个云朵
    context:  canvas.getContext("2d")对象
    cx: 云朵X轴位置
    cy: 云朵Y轴位置
    cw: 云朵宽度
    */
    function drawCloud(context, cx, cy, cw) {
        //云朵移动范围即画布宽度
        var maxWidth = context.canvas.width;
        //如果超过边界从头开始绘制
        cx = cx % maxWidth;
        //云朵高度为宽度的60%
        var ch = cw * 0.6;
        //开始绘制云朵
        context.beginPath();
        context.fillStyle = "white";
        //创建渐变
        var grd = context.createLinearGradient(0, 0, 0, cy);
        grd.addColorStop(0, 'rgba(255,255,255,0.8)');
        grd.addColorStop(1, 'rgba(255,255,255,0.5)');
        context.fillStyle = grd;
        context.fill();
        //在不同位置创建5个圆拼接成云朵现状
        context.arc(cx, cy, cw * 0.19, 0, 360, false);
        context.arc(cx + cw * 0.08, cy - ch * 0.3, cw * 0.11, 0, 360, false);
        context.arc(cx + cw * 0.3, cy - ch * 0.25, cw * 0.25, 0, 360, false);
        context.arc(cx + cw * 0.6, cy, cw * 0.21, 0, 360, false);
        context.arc(cx + cw * 0.3, cy - ch * 0.1, cw * 0.28, 0, 360, false);
        context.closePath();
        context.fill();
    }

    //input提示隐藏
    function hiddenDiv(dom){
        $(dom).css('display','none');
        $(dom).prev("input").css('display','block');
        $(dom).prev("input").focus();
        $(dom).prev("input").val("");
    }
    //input失去焦点显示提示
    function showInput(dom){
        var text = $(dom).val();
        if(!text){
            $(dom).css('display','none');
            $(dom).next('div').css('display','block');
        }else{
            $(dom).css('display','block');
            $(dom).next('div').css('display','none');
        }
    }


</script>
</html>